import React,{Component} from "react";
import { glabalContext } from './common/js/globalData'
const { Consumer } = glabalContext
class ToChild2 extends Component {
  state = {  }
  render() { 
    return (
      <div>
         子组件child2:(我和child是兄弟)
         {/* 也读取父组件的role数据 */}
         <Consumer>
           {
            value =>(<div>{value.role}</div>)
           }
         </Consumer>
      </div>
    );
  }
}
 
export default ToChild2;